#ifndef DCT_H
#define DCT_H
#include "common.h"

typedef struct dct{
    dctcoef luma16x16_dc[3][16];
    dctcoef chroma_dc[2][8];
    dctcoef luma8x8[12][64];
    dctcoef luma4x4[16*3][16];
} dct_t;
void sub4x4_dct( dctcoef dct[16], pixel *pix1, pixel *pix2 );

void sub8x8_dct( dctcoef dct[4][16], pixel *pix1, pixel *pix2 );

void sub16x16_dct( dctcoef dct[16][16], pixel *pix1, pixel *pix2);

void zigzag_scan_4x4_frame(dctcoef level[16], dctcoef dct[16]);
void zigzag_scan_2x4_dc( dctcoef level[8], dctcoef dct[8] );
void zigzag_scan_2x2_dc( dctcoef level[4], dctcoef dct[4] );

void dct4x4dc(dctcoef d[16]);

void idct4x4dc(dctcoef d[16]);

void add16x16_idct( pixel *p_dst, dctcoef dct[16][16]);
void add16x16_idct_dc( pixel *p_dst, dctcoef dct[16]);
void dct2x2dc( dctcoef d[4], dctcoef dct4x4[4][16]);
void dct2x4dc( dctcoef dct[8], dctcoef dct4x4[8][16]);
void idct_dequant_2x4_dconly(dctcoef dct[8], int dequant_mf[6][16], int i_qp);
void idct_dequant_2x2_dconly(dctcoef dct[4], int dequant_mf[6][16], int i_qp);
void add8x8_idct_dc( pixel *p_dst, dctcoef dct[4] );
void add8x8_idct( pixel *p_dst, dctcoef dct[4][16] );
#endif